3.1.46 \(\int \frac {1}{(1+\cos ^2(x))^3} \, dx\) [46]

Optimal. Leaf size=71 \[ \frac {19 x}{32 \sqrt {2}}-\frac {19 \text {ArcTan}\left (\frac {\cos (x) \sin (x)}{1+\sqrt {2}+\cos ^2(x)}\right )}{32 \sqrt {2}}-\frac {\cos (x) \sin (x)}{8 \left (1+\cos ^2(x)\right )^2}-\frac {9 \cos (x) \sin (x)}{32 \left (1+\cos ^2(x)\right )} \]

[Out]

-1/8*cos(x)*sin(x)/(1+cos(x)^2)^2-9/32*cos(x)*sin(x)/(1+cos(x)^2)+19/64*x*2^(1/2)-19/64*arctan(cos(x)*sin(x)/(
1+cos(x)^2+2^(1/2)))*2^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.625, Rules used = {3263, 3252, 12, 3260, 209} \begin {gather*} -\frac {19 \text {ArcTan}\left (\frac {\sin (x) \cos (x)}{\cos ^2(x)+\sqrt {2}+1}\right )}{32 \sqrt {2}}+\frac {19 x}{32 \sqrt {2}}-\frac {9 \sin (x) \cos (x)}{32 \left (\cos ^2(x)+1\right )}-\frac {\sin (x) \cos (x)}{8 \left (\cos ^2(x)+1\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + Cos[x]^2)^(-3),x]

[Out]

(19*x)/(32*Sqrt[2]) - (19*ArcTan[(Cos[x]*Sin[x])/(1 + Sqrt[2] + Cos[x]^2)])/(32*Sqrt[2]) - (Cos[x]*Sin[x])/(8*
(1 + Cos[x]^2)^2) - (9*Cos[x]*Sin[x])/(32*(1 + Cos[x]^2))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3252

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp
[(-(A*b - a*B))*Cos[e + f*x]*Sin[e + f*x]*((a + b*Sin[e + f*x]^2)^(p + 1)/(2*a*f*(a + b)*(p + 1))), x] - Dist[
1/(2*a*(a + b)*(p + 1)), Int[(a + b*Sin[e + f*x]^2)^(p + 1)*Simp[a*B - A*(2*a*(p + 1) + b*(2*p + 3)) + 2*(A*b
- a*B)*(p + 2)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f, A, B}, x] && LtQ[p, -1] && NeQ[a + b, 0]

Rule 3260

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

Rule 3263

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Simp[(-b)*Cos[e + f*x]*Sin[e + f*x]*((a + b*Si
n[e + f*x]^2)^(p + 1)/(2*a*f*(p + 1)*(a + b))), x] + Dist[1/(2*a*(p + 1)*(a + b)), Int[(a + b*Sin[e + f*x]^2)^
(p + 1)*Simp[2*a*(p + 1) + b*(2*p + 3) - 2*b*(p + 2)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, e, f}, x] && N
eQ[a + b, 0] && LtQ[p, -1]

Rubi steps

\begin {align*} \int \frac {1}{\left (1+\cos ^2(x)\right )^3} \, dx &=-\frac {\cos (x) \sin (x)}{8 \left (1+\cos ^2(x)\right )^2}-\frac {1}{8} \int \frac {-7+2 \cos ^2(x)}{\left (1+\cos ^2(x)\right )^2} \, dx\\ &=-\frac {\cos (x) \sin (x)}{8 \left (1+\cos ^2(x)\right )^2}-\frac {9 \cos (x) \sin (x)}{32 \left (1+\cos ^2(x)\right )}-\frac {1}{32} \int -\frac {19}{1+\cos ^2(x)} \, dx\\ &=-\frac {\cos (x) \sin (x)}{8 \left (1+\cos ^2(x)\right )^2}-\frac {9 \cos (x) \sin (x)}{32 \left (1+\cos ^2(x)\right )}+\frac {19}{32} \int \frac {1}{1+\cos ^2(x)} \, dx\\ &=-\frac {\cos (x) \sin (x)}{8 \left (1+\cos ^2(x)\right )^2}-\frac {9 \cos (x) \sin (x)}{32 \left (1+\cos ^2(x)\right )}-\frac {19}{32} \text {Subst}\left (\int \frac {1}{1+2 x^2} \, dx,x,\cot (x)\right )\\ &=\frac {19 x}{32 \sqrt {2}}-\frac {19 \tan ^{-1}\left (\frac {\cos (x) \sin (x)}{1+\sqrt {2}+\cos ^2(x)}\right )}{32 \sqrt {2}}-\frac {\cos (x) \sin (x)}{8 \left (1+\cos ^2(x)\right )^2}-\frac {9 \cos (x) \sin (x)}{32 \left (1+\cos ^2(x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.14, size = 51, normalized size = 0.72 \begin {gather*} \frac {19 \text {ArcTan}\left (\frac {\tan (x)}{\sqrt {2}}\right )}{32 \sqrt {2}}-\frac {\sin (2 x)}{4 (3+\cos (2 x))^2}-\frac {9 \sin (2 x)}{32 (3+\cos (2 x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + Cos[x]^2)^(-3),x]

[Out]

(19*ArcTan[Tan[x]/Sqrt[2]])/(32*Sqrt[2]) - Sin[2*x]/(4*(3 + Cos[2*x])^2) - (9*Sin[2*x])/(32*(3 + Cos[2*x]))

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 35, normalized size = 0.49

method result size
default \(\frac {-\frac {13 \left (\tan ^{3}\left (x \right )\right )}{32}-\frac {11 \tan \left (x \right )}{16}}{\left (\tan ^{2}\left (x \right )+2\right )^{2}}+\frac {19 \arctan \left (\frac {\tan \left (x \right ) \sqrt {2}}{2}\right ) \sqrt {2}}{64}\) \(35\)
risch \(-\frac {i \left (19 \,{\mathrm e}^{6 i x}+171 \,{\mathrm e}^{4 i x}+89 \,{\mathrm e}^{2 i x}+9\right )}{16 \left ({\mathrm e}^{4 i x}+6 \,{\mathrm e}^{2 i x}+1\right )^{2}}+\frac {19 i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}+2 \sqrt {2}+3\right )}{128}-\frac {19 i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i x}-2 \sqrt {2}+3\right )}{128}\) \(82\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(1+cos(x)^2)^3,x,method=_RETURNVERBOSE)

[Out]

(-13/32*tan(x)^3-11/16*tan(x))/(tan(x)^2+2)^2+19/64*arctan(1/2*tan(x)*2^(1/2))*2^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.47, size = 41, normalized size = 0.58 \begin {gather*} \frac {19}{64} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} \tan \left (x\right )\right ) - \frac {13 \, \tan \left (x\right )^{3} + 22 \, \tan \left (x\right )}{32 \, {\left (\tan \left (x\right )^{4} + 4 \, \tan \left (x\right )^{2} + 4\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cos(x)^2)^3,x, algorithm="maxima")

[Out]

19/64*sqrt(2)*arctan(1/2*sqrt(2)*tan(x)) - 1/32*(13*tan(x)^3 + 22*tan(x))/(tan(x)^4 + 4*tan(x)^2 + 4)

________________________________________________________________________________________

Fricas [A]
time = 0.43, size = 81, normalized size = 1.14 \begin {gather*} -\frac {19 \, {\left (\sqrt {2} \cos \left (x\right )^{4} + 2 \, \sqrt {2} \cos \left (x\right )^{2} + \sqrt {2}\right )} \arctan \left (\frac {3 \, \sqrt {2} \cos \left (x\right )^{2} - \sqrt {2}}{4 \, \cos \left (x\right ) \sin \left (x\right )}\right ) + 4 \, {\left (9 \, \cos \left (x\right )^{3} + 13 \, \cos \left (x\right )\right )} \sin \left (x\right )}{128 \, {\left (\cos \left (x\right )^{4} + 2 \, \cos \left (x\right )^{2} + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cos(x)^2)^3,x, algorithm="fricas")

[Out]

-1/128*(19*(sqrt(2)*cos(x)^4 + 2*sqrt(2)*cos(x)^2 + sqrt(2))*arctan(1/4*(3*sqrt(2)*cos(x)^2 - sqrt(2))/(cos(x)
*sin(x))) + 4*(9*cos(x)^3 + 13*cos(x))*sin(x))/(cos(x)^4 + 2*cos(x)^2 + 1)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 439 vs. \(2 (71) = 142\).
time = 3.58, size = 439, normalized size = 6.18 \begin {gather*} \frac {19 \sqrt {2} \left (\operatorname {atan}{\left (\sqrt {2} \tan {\left (\frac {x}{2} \right )} - 1 \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right ) \tan ^{8}{\left (\frac {x}{2} \right )}}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} + \frac {38 \sqrt {2} \left (\operatorname {atan}{\left (\sqrt {2} \tan {\left (\frac {x}{2} \right )} - 1 \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right ) \tan ^{4}{\left (\frac {x}{2} \right )}}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} + \frac {19 \sqrt {2} \left (\operatorname {atan}{\left (\sqrt {2} \tan {\left (\frac {x}{2} \right )} - 1 \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} + \frac {19 \sqrt {2} \left (\operatorname {atan}{\left (\sqrt {2} \tan {\left (\frac {x}{2} \right )} + 1 \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right ) \tan ^{8}{\left (\frac {x}{2} \right )}}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} + \frac {38 \sqrt {2} \left (\operatorname {atan}{\left (\sqrt {2} \tan {\left (\frac {x}{2} \right )} + 1 \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right ) \tan ^{4}{\left (\frac {x}{2} \right )}}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} + \frac {19 \sqrt {2} \left (\operatorname {atan}{\left (\sqrt {2} \tan {\left (\frac {x}{2} \right )} + 1 \right )} + \pi \left \lfloor {\frac {\frac {x}{2} - \frac {\pi }{2}}{\pi }}\right \rfloor \right )}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} + \frac {22 \tan ^{7}{\left (\frac {x}{2} \right )}}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} - \frac {14 \tan ^{5}{\left (\frac {x}{2} \right )}}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} + \frac {14 \tan ^{3}{\left (\frac {x}{2} \right )}}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} - \frac {22 \tan {\left (\frac {x}{2} \right )}}{64 \tan ^{8}{\left (\frac {x}{2} \right )} + 128 \tan ^{4}{\left (\frac {x}{2} \right )} + 64} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cos(x)**2)**3,x)

[Out]

19*sqrt(2)*(atan(sqrt(2)*tan(x/2) - 1) + pi*floor((x/2 - pi/2)/pi))*tan(x/2)**8/(64*tan(x/2)**8 + 128*tan(x/2)
**4 + 64) + 38*sqrt(2)*(atan(sqrt(2)*tan(x/2) - 1) + pi*floor((x/2 - pi/2)/pi))*tan(x/2)**4/(64*tan(x/2)**8 +
128*tan(x/2)**4 + 64) + 19*sqrt(2)*(atan(sqrt(2)*tan(x/2) - 1) + pi*floor((x/2 - pi/2)/pi))/(64*tan(x/2)**8 +
128*tan(x/2)**4 + 64) + 19*sqrt(2)*(atan(sqrt(2)*tan(x/2) + 1) + pi*floor((x/2 - pi/2)/pi))*tan(x/2)**8/(64*ta
n(x/2)**8 + 128*tan(x/2)**4 + 64) + 38*sqrt(2)*(atan(sqrt(2)*tan(x/2) + 1) + pi*floor((x/2 - pi/2)/pi))*tan(x/
2)**4/(64*tan(x/2)**8 + 128*tan(x/2)**4 + 64) + 19*sqrt(2)*(atan(sqrt(2)*tan(x/2) + 1) + pi*floor((x/2 - pi/2)
/pi))/(64*tan(x/2)**8 + 128*tan(x/2)**4 + 64) + 22*tan(x/2)**7/(64*tan(x/2)**8 + 128*tan(x/2)**4 + 64) - 14*ta
n(x/2)**5/(64*tan(x/2)**8 + 128*tan(x/2)**4 + 64) + 14*tan(x/2)**3/(64*tan(x/2)**8 + 128*tan(x/2)**4 + 64) - 2
2*tan(x/2)/(64*tan(x/2)**8 + 128*tan(x/2)**4 + 64)

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 68, normalized size = 0.96 \begin {gather*} \frac {19}{64} \, \sqrt {2} {\left (x + \arctan \left (-\frac {\sqrt {2} \sin \left (2 \, x\right ) - \sin \left (2 \, x\right )}{\sqrt {2} \cos \left (2 \, x\right ) + \sqrt {2} - \cos \left (2 \, x\right ) + 1}\right )\right )} - \frac {13 \, \tan \left (x\right )^{3} + 22 \, \tan \left (x\right )}{32 \, {\left (\tan \left (x\right )^{2} + 2\right )}^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(1+cos(x)^2)^3,x, algorithm="giac")

[Out]

19/64*sqrt(2)*(x + arctan(-(sqrt(2)*sin(2*x) - sin(2*x))/(sqrt(2)*cos(2*x) + sqrt(2) - cos(2*x) + 1))) - 1/32*
(13*tan(x)^3 + 22*tan(x))/(tan(x)^2 + 2)^2

________________________________________________________________________________________

Mupad [B]
time = 2.15, size = 53, normalized size = 0.75 \begin {gather*} \frac {19\,\sqrt {2}\,\left (x-\mathrm {atan}\left (\mathrm {tan}\left (x\right )\right )\right )}{64}-\frac {\frac {13\,{\mathrm {tan}\left (x\right )}^3}{32}+\frac {11\,\mathrm {tan}\left (x\right )}{16}}{{\mathrm {tan}\left (x\right )}^4+4\,{\mathrm {tan}\left (x\right )}^2+4}+\frac {19\,\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\mathrm {tan}\left (x\right )}{2}\right )}{64} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x)^2 + 1)^3,x)

[Out]

(19*2^(1/2)*(x - atan(tan(x))))/64 - ((11*tan(x))/16 + (13*tan(x)^3)/32)/(4*tan(x)^2 + tan(x)^4 + 4) + (19*2^(
1/2)*atan((2^(1/2)*tan(x))/2))/64

________________________________________________________________________________________